import { ConfigProvider } from "antd";
import { Spin } from "antd";
import { Suspense } from "react";
import { FC } from "react";
import { useRoutes } from "react-router-dom";
import "dayjs/locale/zh-cn";
import zhCN from "antd/locale/zh_CN";
import routes from "./route/Index";

interface Props {}
const App: FC<Props> = () => {
  return (
    <Suspense
      fallback={
        <div
          style={{
            width: "100vw",
            height: "100vh",
            display: "flex",
            justifyContent: "center",
            alignItems: "center",
          }}
        >
          <Spin size="large"></Spin>
        </div>
      }
    >
      <ConfigProvider locale={zhCN}>{useRoutes(routes)}</ConfigProvider>
    </Suspense>
  );
};
export default App;
